import json
from app import teampost
# 以下是測試程式碼

from message_handler import summarize_all_messages, summarize_certain_messages, add_message
date = '2024-02-06' 
target_list = ['3841752']

summaries = summarize_certain_messages(date,target_list)

#summaries = summarize_all_messages(date)
print(summaries)
if summaries == '服务出错':
    print('服务出错')

else:
    # 遍历字典的所有项
    for target, summary in summaries.items():
        info = '以下为群:'+target + '于' + date + '的消息总结：\n\n' + summary
        teampost('grp.yunxintalkmate@corp.netease.com','4544838',info)
